<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Recruit extends Backdata_controller{
	var $rule_post=array(
		array(
			'field'=>'title',
			'label'=>'职位名称 ',
			'rules'=>'required|max_lenx[255]'),
		array(
			'field'=>'type_id',
			'rules'=>'intval'),
		array(
			'field'=>'show',
			'rules'=>'intval'),
		array(
			'field'=>'amount',
			'rules'=>'intval'),
		array(
			'field'=>'timeline',
			'rules'=>'trim'),
		array(
			'field'=>'gender',
			'rules'=>'trim'),
		array(
			'field'=>'age',
			'rules'=>'intval'),
		array(
			'field'=>'age_max',
			'rules'=>'intval'),
		array(
			'field'=>'content',
			'rules'=>'trim'),
		array(
			'field'=>'place',
			'rules'=>'trim'),
		array(
			'field'=>'edu',
			'rules'=>'trim'),
		array(
			'field'=>'workyear',
			'rules'=>'trim'),
		array(
			'field'=>'salary',
			'rules'=>'trim'),
		array(
			'field'=>'field1',
			'rules'=>'trim'),
		array(
			'field'=>'field2',
			'rules'=>'trim'),
		array(
			'field'=>'field3',
			'rules'=>'trim'),
		array(
			'field'=>'field4',
			'rules'=>'trim'),
		);	
		
	function on_load(){
		$this->load->model('dataset_atom','my_model');
		$this->load->library('category');
		$this->view=$this->table=strtolower(get_class($this));
		$this->category->table_name('admin_act');
		$this->category->block(strtolower(get_class($this)));
		$this->category->type_id($this->uri->segment(3,-1));
		$type_tree=$this->category->type_tree();
		$this->load->vars(array('type_tree'=>$type_tree));
	}

	function on_post(){
		return array('rule'=>$this->rule_post);
	}
	
	function on_put(){
		return array('rule'=>$this->rule_post);
	}
}